/*
 * @lc app=leetcode.cn id=1313 lang=typescript
 *
 * [1313] 解压缩编码列表
 */

// @lc code=start
function decompressRLElist(nums: number[]): number[] {
    let result: number[] = [];
    for (let i = 1; i < nums.length; i += 2) {
        let times = nums[i - 1];
        const key = nums[i];
        while (times) {
            times--;
            result.push(key);
        }
    }
    return result;
}
// @lc code=end
